package com.vlada.studzad.data;

import java.util.ArrayList;
import java.util.List;

import com.vlada.studzad.util.Formats;
import com.vlada.studzad.model.JobOffer;
import com.vlada.studzad.model.TypeOfWork;

public class MockDataJobOfferSource{

	private List<JobOffer> jobOffers = new ArrayList<JobOffer>();

	

	public MockDataJobOfferSource() {
		addJobOffer(new JobOffer("asd", "asd", TypeOfWork.LONGTERM, Formats.parseDate("11/21/2010")));
		addJobOffer(new JobOffer("zxc", "zxc", TypeOfWork.SEASON, Formats.parseDate("11/23/2010")));
		addJobOffer(new JobOffer("vbn", "vbn", TypeOfWork.LONGTERM, Formats.parseDate("11/25/2010")));
	}	


	public List<JobOffer> getAllJobOffers() {
		return jobOffers;
	}

	public JobOffer getJobOfferByID(long ID) {
		for (JobOffer s : jobOffers) {
			if(s.getJobOfferID()==ID){
				return s;
			}
		}
		return null;
	}

	public void addJobOffer(JobOffer em) {
		long newId = jobOffers.size();
		em.setJobOfferID(newId);
		jobOffers.add(em);		
	}
}
